package com.feicheng.controller.wx;

import com.alibaba.fastjson.JSONObject;
import com.feicheng.common.result.ResultInfo;
import com.feicheng.persistence.entity.Amenjin;
import com.feicheng.service.a.FMjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("/wx/mj")
@RequestMapping("/wx/mj")
public class MjController {

    @Autowired
    FMjService mjService;

    @PostMapping("/info/put")
    public ResultInfo updateMj(@RequestBody Amenjin amenjin) {
        JSONObject param = new JSONObject();
        param.put("amenjin", amenjin);
        param = mjService.updateMj(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/info")
    public ResultInfo newMj(@RequestBody Amenjin amenjin) {
        JSONObject param = new JSONObject();
        param.put("amenjin", amenjin);
        param = mjService.newMj(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/info/del")
    public ResultInfo deleteMj(@RequestBody JSONObject param) {
        param = mjService.deleteMj(param);
        return ResultInfo.success(param);
    }
}
